﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="List.aspx.cs" Inherits="List" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:DataList ID="DataList4" runat="server" DataKeyField="id" DataSourceID="SqlDataSource1">
        <ItemTemplate>
            <asp:HyperLink ID="HyperLink6" runat="server" Font-Size="15pt" 
                 Text='<%# Eval("Name") %>'></asp:HyperLink>
            <br />
        </ItemTemplate>
    </asp:DataList>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MayPhatDien %>" SelectCommand="SELECT * FROM [categories] WHERE ([id] = @id)">
        <SelectParameters>
            <asp:QueryStringParameter Name="id" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>



    <br />
    
    <div id="machine">

        <asp:DataList ID="DataList1" runat="server" DataKeyField="Id"
            DataSourceID="SqlDataSource2" RepeatColumns="3">
            <ItemTemplate>
                <div id="item">
                <table style="width: 100%">
                    <tr>
                        <td>
                            <asp:Label ID="Label4" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
                        </td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        
                        <td colspan="2">
                           <asp:HyperLink ID="HyperLink5"  style="width:130pt;height:120pt;" runat="server"  ImageUrl='<%# Eval("Image") %>'
                                NavigateUrl='<%# "Detail.aspx?ID="+Eval("ID") %>' ImageHeight="150px" ImageWidth="160px">No images</asp:HyperLink>
                        </td>
                            
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label5" runat="server" Text="Giá:"></asp:Label>
                            <asp:Label ID="Label6" runat="server"
                                Text='<%# Eval("Price","{0:#,##0 VND}") %>'></asp:Label>
                        </td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
             
                        <td colspan="2">
                            <div id="ct">
                                <asp:HyperLink ID="HyperLink3" runat="server" Width="100pt"
                                    NavigateUrl='<%# "Detail.aspx?ID="+Eval("ID") %>'>.</asp:HyperLink>
                            </div>
                        </td>
                    </tr>
                </table>
                </div>
            </ItemTemplate>
        </asp:DataList>
    </div>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:MayPhatDien %>" 
        SelectCommand="SELECT * FROM [machine] WHERE ([idcategories] = @idcategories)">
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="" Name="idcategories" QueryStringField="ID" 
                Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Content>

